package com.jiulan.hearthearing.ui.school.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiulan.hearthearing.R;
import com.jiulan.hearthearing.ui.school.model.SchoolModel;

import java.util.List;

public class SchoolBookAdapter extends BaseQuickAdapter<SchoolModel.DataBean.ShujiBean, BaseViewHolder> {

    public SchoolBookAdapter(List<SchoolModel.DataBean.ShujiBean> data) {
        super(R.layout.item_school_book, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SchoolModel.DataBean.ShujiBean item) {
        ImageView nivPic = helper.getView(R.id.nivPic);
        Glide.with(mContext).load(item.getImage()).into(nivPic);
        helper.setText(R.id.tvTitle, item.getTitle());
        helper.setText(R.id.tvContent, item.getShortX());
//        helper.setText(R.id.tvAuthor, item.getLecturer().getName() + "·" + item.getLecturer().getTitle());
        helper.setText(R.id.tvPrice, String.valueOf(item.getPrice()) + "学习币");
        helper.addOnClickListener(R.id.tvCheck);
    }
}
